
cmake_minimum_required(VERSION 3.18.1)

project("x264cameraxpush")
# 链接 src/main/cpp/librtmp 目录下的构建脚本
add_subdirectory(librtmp)

# 引入 x264 代码库
message("===============daidai=============")
message(${CMAKE_ANDROID_ARCH_ABI})

include_directories(${CMAKE_SOURCE_DIR}/x264/${CMAKE_ANDROID_ARCH_ABI}/include)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/x264/${CMAKE_ANDROID_ARCH_ABI}/lib")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SORCE_DIR}/x264/${ANDROID_ABI}/lib")

file(GLOB cpp_source *.cpp)

add_library(
             x264cameraxpush
             SHARED
             ${cpp_source})

find_library(
              log-lib
              log )

target_link_libraries( # Specifies the target library.
                       x264cameraxpush
                        log
                        rtmp
                        x264)
